package controller;

import java.util.*;
import load.parent.Store;
import load.storage.StoreIO;

/**
 * @author Ben
 */
public class StoreFactory {
    public static final Integer DEFAULT_INT = new Integer(0);
    public static final Double DEFAULT_DOUBLE = new Double(0.0);
    public static final String DEFAULT_STRING = "null";
    public static final Boolean DEFAULT_BOOLEAN = Boolean.TRUE;
    

    public static Store createStore(String simpleNameStore) {
       Store result = null;
       if(simpleNameStore.equals("String"))
            result =  new load.storage.String("nul");
       else if (simpleNameStore.equals("StoreIO"))
            result =  new StoreIO(new String("0"));
       else if(simpleNameStore.equals("Store"))
            result =  new Store(new Integer(0));
       else if(simpleNameStore.equals("Integer"))
            result =  new load.storage.Integer(new Integer(0));
       else if(simpleNameStore.equals("Boolean"))
            result =  new load.storage.Boolean(new Boolean(false));
       else if(simpleNameStore.equals("Double"))
            result =  new load.storage.Double(new Double(0.0));
       else if(simpleNameStore.equals("Object"))
            result =  new load.storage.Object(new Object());
       else if(simpleNameStore.equals("ArrayList"))
            result =  new load.collections.ArrayList(new ArrayList());
       else if(simpleNameStore.equals("HashMap"))
            result =  new load.collections.HashMap(new HashMap());
       else if(simpleNameStore.equals("LinkedList"))
            result =  new load.collections.LinkedList(new LinkedList());
       else if(simpleNameStore.equals("Stack")){
            result =  new load.collections.Stack(new Stack());
       }
       return result;
    }
}
